package es.cursojavaee.ejb.stateful.cdi;

import javax.ejb.Stateful;
import javax.inject.Inject;

@Stateful
public class HolaBean implements IHolaBean {

	private static final String MESSAGE = "Te he respondido \"%s\" %d veces.";

	private int contador = 0;

	@Inject
	private HolaService holaService;

	@Override
	public String sayHello(final String nombre) {
		return String.format(MESSAGE, holaService.sayHello(nombre), contador++);
	}
}
